﻿<UserControl x:Class="Video.ThumbnailControl"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             Width="250" Height="170" Margin="5" RenderTransformOrigin="0.5,0.5"
             Loaded="UserControlLoaded" MouseLeftButtonDown="UserControlMouseLeftButtonDown" MouseLeftButtonUp="UserControlMouseLeftButtonUp" MouseLeave="UserControlMouseLeave">
    <UserControl.Resources>
        <Storyboard x:Key="MouseDownAnim">
            <DoubleAnimation Storyboard.TargetName="Scale" Storyboard.TargetProperty="ScaleX" To="0.9" Duration="0:0:0.05" AccelerationRatio="0.3" DecelerationRatio="0.7"/>
        </Storyboard>
        <Storyboard x:Key="MouseUpAnim">
            <DoubleAnimation Storyboard.TargetName="Scale" Storyboard.TargetProperty="ScaleX" To="1" Duration="0:0:0.05" AccelerationRatio="0.3" DecelerationRatio="0.7"/>
        </Storyboard>
    </UserControl.Resources>
    <UserControl.RenderTransform>
        <TransformGroup>
            <ScaleTransform x:Name="Scale" ScaleX="1" ScaleY="{Binding ElementName=Scale, Path=ScaleX}"/>
            <TranslateTransform x:Name="Translate"/>
        </TransformGroup>
    </UserControl.RenderTransform>
    <Grid>
        <Image Name="ThumbnailImage" Stretch="UniformToFill" HorizontalAlignment="Center"/>
        <Grid VerticalAlignment="Bottom">
            <Rectangle Fill="Black" Opacity="0.5"/>
            <StackPanel Margin="5,5,5,10">
                <TextBlock Name="Title" Foreground="White" FontSize="16" TextTrimming="CharacterEllipsis"/>
                <TextBlock Name="Duration" Foreground="LightGray" FontSize="14" TextTrimming="CharacterEllipsis"/>
            </StackPanel>
        </Grid>
    </Grid>
</UserControl>
